<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/commons.jsp"%>

<form id="pagerForm" method="post" action="sys/depts/list.action">
	<input type="hidden" name="pageNum" value="${pageNum}" />
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	
	<input type="hidden" name="dept.deptName" value="${dept.deptName}"/>
	<input type="hidden" name="dept.deptType" value="${dept.deptType}"/>
</form>

<form method="post" action="sys/depts/list.action" onsubmit="return navTabSearch(this)">
	
	<div class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>部门名称：</label>
					<input type="text" name="dept.deptName" value="${dept.deptName}"/>
				</li>
				<li>
					<label>部门类型：</label>
					<select name="dept.deptType">
						<option value="">--选择类型--</option>
					<c:forEach items="${deptType}" var="item">
						<option value="${item.value}" <c:if test="${item.value eq dept.deptType}">selected</c:if>>${item.name}</option>
					</c:forEach>
					</select>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
				</ul>
			</div>
		</div>
	</div>
</form>

<div class="pageContent">

	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" target="navTab" rel="deptAddNav" href="sys/depts/add.action?op=add" title="新建部门"><span>新建</span></a></li>
			<li><a class="edit" target="navTab" rel="deptEditNav" href="sys/depts/add.action?op=modify&dept.deptId={slt_uid}" warn="请选择一个部门"><span>修改</span></a></li>
			<li><a class="delete" target="ajaxTodo" href="sys/depts/delete.action?dept.deptId={slt_uid}" title="确定要删除吗?" warn="请选择一个部门"><span>删除</span></a></li>
			<li class="line">line</li>
			<li><a class="icon" href="/management/dept!export.do" target="dwzExport" targetType="navTab" title="确定要导出?"><span>导出</span></a></li>
		</ul>
	</div>
	
	<table class="table" layoutH="138" width="100%">
		<thead>
			<tr>
				<th width="100" orderField="deptName" class="${param.orderField eq 'deptName' ? param.orderDirection : ''}">部门名</th>
				<th width="100" orderField="deptType" class="${param.orderField eq 'deptType' ? param.orderDirection : ''}">部门类型</th>
				<th width="90" orderField="deptOrd" class="${param.orderField eq 'deptOrd' ? param.orderDirection : ''}">部门排序</th>
				<th width="100">编辑</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${deptList}">
			<tr target="slt_uid" rel="${item.deptId}">
				<td><a href="sys/depts/view.action?dept.deptId=${item.deptId}" rel="deptViewNav" title="查看部门-${item.deptName}" target="navTab">${item.deptName}</a></td>
				<td><c:forEach items="${deptType}" var="t">
						<c:if test="${item.deptType eq t.value}">${t.name}</c:if>
					</c:forEach></td>
				<td>${item.deptOrd}</td>
				<td><a href="sys/users/list.action" rel="addUsers" target="navTab">添加人员</a></td>
			</tr>
			</c:forEach>
			<c:if test="${empty deptList || fn:length(deptList)==0}">
				<tr><td colspan="6"><div style="color: red;margin-left: 12px;">提示：暂无数据</div></td></tr>
			</c:if>
		</tbody>
	</table>
	
	<!-- 分页 -->
	<c:import url="/commons/pager/panelBar.jsp"></c:import>
	
</div>


